package org.example.utils;

public class Result {
    private String msg;
    private Integer code;
    private Object data;

    public Result(String msg, Integer code, Object data) {
        this.msg = msg;
        this.code = code;
        this.data = data;
    }

    public static Result success(String msg,Integer code,Object data){
        return new Result(msg,code,data);
    }
    public static Result success(String msg,Integer code){
        return new Result(msg,code,null);
    }

    public static Result error(String msg,Integer code,Object data){
        return new Result(msg,code,data);
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


}
